home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
a_utils
/
expanded.lha
/
expanded
/
hdr
/
Object.h
< prev
next >
Wrap
C/C++ Source or Header
|
1992-03-19
|
4KB
|
152 lines
//
// Linear-Affine-Projective Geometry Package
//
// Object.h
//
// $Header$
//
// William J.R. Longabaugh
// University of Washington
//
// Implementation of the linear-affine-projective geometry
// package described in William J.R. Longabaugh, "An Expanded
// System for Coordinate-Free Geometric Programming", Master's
// thesis, University of Washington, 1992.
//
// Copyright (c) 1992, William J.R. Longabaugh
// Copying, use and development for non-commercial purposes permitted.
// All rights for commercial use reserved.
// This software is unsupported and without warranty; it is
// provided "as is".
//
// ***********************************************************************
#ifndef Object_h
#define Object_h
#include <stream.h>
#include "Lap1.h"
#include "Typeout.h"
// Define nil pointer:
#define nil ((void *)0)
// Indent blocks in error outputs by 3 columns:
const int ERR_IND = 3;
// A line of asterisks:
extern const char *ast;
// ***********************************************************************
//
// Every class (except the error handler) in the package is a subclass
// of this class. Objects know how to print themselves out for
// error messages. The print function is virtual, and is implemented
// by each different object.
//
class Object
{
friend ostream& operator<<(ostream &c, Object &o);
public:
virtual void debug_out(ostream &c, int indent) {};
};
// ***********************************************************************
//
// A special class that is used to print out numeric values in
// error messages.
//
class ErrVal: public Object
{
private:
char *text;
Boolean isint;
Scalar value;
public:
// Constructors / Destructors:
ErrVal(char *message, Scalar val);
ErrVal(char *message, int val);
~ErrVal(void);
// To do debug printing:
void debug_out(ostream &c, int indent);
};
// ***********************************************************************
//
// A special class that is used to enumeration types in error messages.
//
class ErrType: public Object
{
private:
char *text;
int value;
EnumSet set;
public:
// Constructors / Destructors:
ErrType(char *message, int val, EnumSet s);
~ErrType(void);
// To do debug printing:
void debug_out(ostream &c, int indent);
};
// ***********************************************************************
//
// This class of objects handles error reporting.
//
class ErrorHandler
{
public:
// Creation:
ErrorHandler(void);
// A whole bunch of error handling functions to handle different numbers
// of Objects:
void ErrorExit(char *errloc, char *descript);
void ErrorExit(char *errloc, char *descript, Object &o1);
void ErrorExit(char *errloc, char *descript, Object &o1,
Object &o2);
void ErrorExit(char *errloc, char *descript, Object &o1,
Object &o2, Object &o3);
void ErrorExit(char *errloc, char *descript, Object &o1,
Object &o2, Object &o3, Object &o4);
void ErrorExit(char *errloc, char *descript, Object &o1,
Object &o2, Object &o3, Object &o4, Object &o5);
};
// ***********************************************************************
// ***********************************************************************
//
// Announce the existence of the global error handler:
//
extern ErrorHandler errh;
// ***********************************************************************
// ***********************************************************************
#endif